<template>
  <div class="mb-10px">
    <el-tooltip trigger="hover" effect="light" placement="left-start">
      <SvgIcon
        class="ml-5px cursor-pointer"
        :name="svgName"
        :color="iconColor"
        :width="size"
        :height="size"
        @click="handleClick"
      />
     
      <template #content>
        <p class="text-center text-16px">{{content}}</p>
        <!-- <img src="/code.jpg" /> -->
      </template>
    </el-tooltip>
    <p class="ml--3px text-15px text-center mt--2px mb-10px">关注我们</p>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";

const props = defineProps({
  svgName: {
    type: String,
    default: () => "exclamation",
  },
  content: {
    type: String,
    default: () => "微信公众号",
  },
  size: {
    type: String,
    default: () => "20px",
  },
  iconColor: {
    type: String,
    default: () => "#fff",
  },
  path: {
    type: String,
    default: () => "/",
  },
  type: {
    type: String,
    default: () => "",
  },
});

const $router = useRouter();

const handleClick = () => {
  if (props.type === "backTop") {
    document.body.scrollTop = document.documentElement.scrollTop = 0;
  } else {
    $router.push(props.path);
  }
};
</script>

<style scoped></style>
